<template>
  <page class="me" :top="0">
    <div class="head">
      <div class="head_div">
        <img src="../../public/img/me_settin_2.png" class="head_Setup">
      </div>
      <div class="head_div1">
        <img class="head_avatar" src="../../public/img/wxPay/useravater.png">
        <div class="head_text">
          编码猿Code
        </div>
      </div>
    </div>

    <ul class="metype">
      <li class="metype_li" v-for=" v, index in metype" :key="index"
        @click="push({ name: 'metype', query: { id: v.typeid } })">
        <img class="metype_img" :src="v.typeurl">
        <div class="metype_text">{{ v.typeext }}</div>
      </li>
    </ul>

    <ul class="melist">
      <li class="melist_li" v-for="v, index in melist" :key="index" @click="listmethon(v.listid)">
        <img class="melist_img" :src="v.listurl">
        <div class="melist_text">{{ v.listtext }}</div>
      </li>
    </ul>
  </page>
</template>

<script setup lang="ts">
import { usermethod, userlike, useradd } from "@/serve/_";
import { setItem, isPhone } from "@/utils/index";

import { showSuccessToast, showFailToast } from 'vant';
import { useRouterAction } from "@/utils/router";
const { back, push } = useRouterAction()
import { onMounted, reactive, ref, computed, onUnmounted, getCurrentInstance } from "vue";
const metype: {
  typeext: string,
  typeurl: string,
  typeid: number
}[] = [
    {
      typeext: "全部订单",
      typeurl: "../../public/img/me_1.png",
      typeid: -1
    },
    {
      typeext: "待付款",
      typeurl: "../../public/img/me_2.png",
      typeid: 0
    },
    {
      typeext: "代发货",
      typeurl: "../../public/img/me_3.png",
      typeid: 1
    },
    {
      typeext: "待收货",
      typeurl: "../../public/img/me_4.png",
      typeid: 2
    },
    {
      typeext: "退款/售后",
      typeurl: "../../public/img/me_5.png",
      typeid: 3
    }
  ]

const melist: {
  listurl: string,
  listtext: string,
  listid: number
}[] = [
    {
      listurl: "../../public/img/me_address.png",
      listtext: "收货地址",
      listid: 1
    }, {
      listurl: "../../public/img/me_like.png",
      listtext: "我的收藏",
      listid: 2
    }, {
      listurl: "../../public/img/me_settin_2.png",
      listtext: "我的设置",
      listid: 3
    },
  ]

const listmethon = (id: number) => {
  switch (id) {
    case 1:

      break;
    case 2:
      //我的收藏 改 name：
      push({ name: "likes" })
      break;
    case 3:

      break;
    default:
      break;
  }
}
</script>

<style scoped lang="less">
@import "@page/me.less";
</style>
